/*
 * Animation.h
 *
 *  Created on: 30/05/2013
 *      Author: vitor
 */

#ifndef ANIMATION_H_
#define ANIMATION_H_

#include "Sprite.h"
#include <string>
#include <algorithm>

class Animation: public Sprite {
private:
	int numSprites;
	int timeInMilliseconds;
	int frameSkip;
	int frameTimeInMilliseconds;

public:
	Animation(std::string fileName, int frameTimeInMilliseconds,
			int numSprites);
	virtual ~Animation();

	void update(double dt);
	void setFrame(int frame);

	int getFrameTime() const {
		return frameTimeInMilliseconds;
	}

	void setFrameTime(int frameTime) {
		this->frameTimeInMilliseconds = std::max(1, frameTime);
	}

	int getNumSprites() const {
		return numSprites;
	}
};

#endif /* ANIMATION_H_ */
